package com.zone.mybatis.executor.statement;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2024/1/1
 */
public abstract class BaseStatementHandler implements StatementHandler {

    @Override
    public Statement prepare(Connection connection) throws SQLException {
        Statement statement = this.instantiateStatement(connection);
        statement.setQueryTimeout(350);
        statement.setFetchSize(10000);
        return statement;
    }

    public abstract Statement instantiateStatement(Connection connection) throws SQLException;
}
